package org.jeecg.modules.yunpian;

import com.yunpian.sdk.YunpianClient;
import com.yunpian.sdk.model.Result;
import com.yunpian.sdk.model.SmsSingleSend;

import java.util.Map;

import static com.yunpian.sdk.constant.YunpianConstant.MOBILE;
import static com.yunpian.sdk.constant.YunpianConstant.TEXT;

public class YunPianSmsApi {

    //短信zzc
//    private final static String apiKey = "b3232c91e3336d52ae80b73bb0a1cb91";
    private final static String apiKey = "b3232c91e3336d52ae80b73bb0a1cb91________";

    public static Result<SmsSingleSend> ypSendMsg(String mobile, String text) {
        YunpianClient clnt = new YunpianClient(apiKey).init();
        Map<String, String> param = clnt.newParam(2);
        param.put(MOBILE, mobile);
        param.put(TEXT, text);
        Result<SmsSingleSend> r = clnt.sms().single_send(param);
        System.out.println(r);
        return r;
    }
}
